<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>弹性布局</title>
    <style>
        .box{
            width:300px;
            height: 300px;
            border:3px solid #f00;
            /*设置弹性*/
            display: flex;
            /*排列方向*/
            /*flex-direction: row-reverse;*/
            /*flex-direction: column;*/
            flex-direction: row;
            /*是否换行*/
            flex-wrap:wrap;
            /*水平对齐方式*/
            /*justify-content: flex-end;*/
            justify-content: center;
        }
        .box div{
            width: 120px;
            height: 100px;
            border:2px solid #0f0;
        }
    </style>
</head>
<body>
<div class="box">
    <div>第一个盒子</div>
    <div>第二个盒子</div>
    <div>第三个盒子</div>
</div>
</body>
</html>